package com.geek.water.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author yangwenqi
 * @decs TODO
 * @date 2025/7/28
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("menu")
@ApiModel("菜单信息")
public class Menu implements Serializable {

    @TableId("id")
    @ApiModelProperty("菜单ID")
    private Integer id;

    @TableField("name")
    @ApiModelProperty("菜单名称")
    private String name;

    @TableField("path")
    @ApiModelProperty("路由路径")
    private String path;

    @TableField("component")
    @ApiModelProperty("组件路径")
    private String component;

    @TableField("priority")
    @ApiModelProperty("排序优先级")
    private int priority;

    @TableField("parentMenuId")
    @ApiModelProperty("父菜单ID，0表示顶级菜单")
    private int parentMenuId;

    @TableField("level")
    @ApiModelProperty("菜单层级")
    private int level;

    @TableField("keep_alive")
    @ApiModelProperty("是否缓存路由：0-不缓存，1-缓存")
    private Boolean keepAlive;


    @TableField("meta_id")
    @ApiModelProperty("关联的元数据ID")
    private Integer metaId;

    // 一对一关联 Meta
    @TableField(exist = false)
    @ApiModelProperty("菜单元数据")
    private Meta meta;
}
